<template>
    <div class="top-bar">
        <div class="logo">
            <img src="@/assets/images/logo/yksg.svg" alt="" class="logo-img">
            <p class="logo-name">一刻时光</p>
        </div>
        <div class="menu">
            <yk-button :nom="id==0?'cprimary':'csecondary'" class="menu-message" @click="changeWall(0)">留言墙</yk-button>
            <yk-button :nom="id==1?'cprimary':'csecondary'" class="menu-photo" @click="changeWall(1)">照片墙</yk-button>
        </div>
        <div class="user">
            <div class="user-header"></div>
        </div>
    </div>
</template>

<script>
    import ykButton from "@/components/YkButton.vue"

    export default {
        data() {
            return {

            }
        },
        components: {
            ykButton
        },
        computed: {
            id() {
                return this.$route.query.id
            }
        },
        methods: {
            // 切换路由id
            changeWall(e) {
                this.$router.push({
                    query:{id:e},
                });
                // window.location.reload();
            }
        }
    }
</script>


<style lang="less" scoped>
    .top-bar {
        width: 100%;
        height: 52px;
        background-color: rgba(255, 255, 255, .8);
        box-shadow: 0 0 4px 0 rgba( 0, 0, 0, .1);
        backdrop-filter: blur(10px);
        position: fixed;
        top: 0;
        left: 0;
        z-index: 100;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 30px;
        box-sizing: border-box;
    }

    .logo {
        width: 200px;;
        display: flex;
        align-items: center;
    }

    .logo-name {
        font-size: 20px;
        color: @gray-0;
        font-weight: 600;
        letter-spacing: 1.5px;
        margin: 0 0 0 10px;
    }

    .menu {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .user {
        width: 200px;
    }

    .user-header {
        border-radius: 50%;
        height: 36px;
        width: 36px;
        background-image: linear-gradient(180deg, #7BE7FF 2%, #1E85E2 2%);
        float: right;
    }

    .menu-photo {
        margin: 0 0 0 24px;
    }
</style>